package net.hangar5.xmlrpc;

/* CallException.java

The contents of this file are subject to the Mozilla Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.

The Original Code is "Hangar5 XMLRPC Library".

The Initial Developer of the Original Code is James D. Rudnicki.  
Portions created by James D. Rudnicki are
Copyright (C) 2001.  All Rights Reserved.

Contributor(s): 
*/
/** Exception for XML-RPC protocol errors.
 *
 */
public class RpcException extends java.lang.Exception {

  /** Code for ... */
  public static final int GENERIC = 100;
  public static final String SGENERIC = "generic error";

  /** Code for parsing failures */
  public static final int PARSE = 101;

  /** Code for Method name does not exist on server */
  public static final int NOSUCHMETHOD = 102;
  
  public static final String SNOSUCHMETHOD = "no such method";
  
  /** Code for mismatched parameter type */
  public static final int BADPARAMTYPE = 105;
  
  public static final String SBADPARAMTYPE = "bad parameter type";

  /** Code for parameter value that does not parse to specified type. */
  public static final int BADPARAMVALUE = 106;
  
  public static final String SBADPARAMVALUE = "bad parameter value";

  public static final int APPCODE = 200;
  
  private int nCode = 0;
  
  /**
	* Constructs an <code>CallException</code> with no detail message.
	* @param msg the detail message.
	*/
  public RpcException(int n) {
	nCode = n;
  }  
  /**
	* Creates new <code>CallException</code> without detail message.
	*/
  public RpcException(int n,String s) {
	super( s );
	nCode = n;
  }  
  public int getCode() {
	return nCode;
  }  
} // end of class
